A conventional profiler for a desktop application can readily derive information to allow for the collection of data from a desktop application based on user supplied strings provided when the user launches the desktop application. This information includes the location of the desktop application on disk, a working directory, and a parameter list. With this information, along with a list of additional modules of interest, and the ability to inject a profiler helper into the desktop application, the profiler can perform any necessary preprocessing on the application code and then launch the application under its control. All lifetime and communication issues can be managed with this knowledge and level of control.
FIG. 1 illustrates a block diagram for a conventional prior art profiler for a desktop application. A system 100 includes a code profiling tool 110, a desktop application being profiled 120, and a profile helper 130. The profile helper 130 may be injected into the desktop application being profiled 120 and may collect profiling data during the execution of the desktop application 120. For example, the profiler helper 130 may collect data at regular sampling intervals. Furthermore, the code profiling tool 110 may initiate the code profiling session by launching 150 the desktop application. To accomplish the data collection, the code profiling tool 110 may instrument one or more executables (i.e., binary files) of the desktop application 120, whereby probe instructions are inserted into one or more executable files (e.g., application executables, shared libraries, etc.) associated with the desktop application 120, and the probe instructions can send 160 profiling data to the code profiling tool 110. Examples of the profiling data may include a call stack chain, call counts, call cost, memory usage, CPU usage, and I/O operations. In such a system 100, a process boundary 140 between the desktop application being profiled 120 and the code profiling tool 110 is well-defined, thereby facilitating the profiling process.